package com.ithei.多线程第二天.原子性;

import java.util.concurrent.atomic.AtomicInteger;

public class Demo1x implements Runnable {
    public AtomicInteger count = new AtomicInteger(0);

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(count.incrementAndGet());

        }
    }
}

class Testx {
    public static void main(String[] args) {
        Demo1 demo = new Demo1();
        for (int i = 0; i < 1000; i++) {
            new Thread(demo).start();
        }
    }
}
